import { datashopAxios } from '@/utils/request'

export const getProjectList = (params: any): Promise<any> => {
  return datashopAxios({
    url: `/api/project/v2/projects`,
    method: 'get',
    params
  })
}

export const addProjectList = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/project/v2/projects`,
    method: 'post',
    data
  })
}

export const editProjectList = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/project/v2/projects/${data.id}`,
    method: 'put',
    data
  })
}

export const deleteProjectList = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/project/v2/projects/${data.id}`,
    method: 'delete',
    data
  })
}

export const getProjectInfor = (params: any): Promise<any> => {
  return datashopAxios({
    url: `/api/project/v2/projects/${params.id}`,
    method: 'get',
    params
  })
}

export const getProjectLog = (params: any): Promise<any> => {
  return datashopAxios({
    url: `/api/project/v2/projects/${params.id}/operations`,
    method: 'get',
    params
  })
}
